package com.kgc.dao;

import com.kgc.entity.Role;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
@Mapper
public interface RoleDao {

    Role getRoleByUserId(Integer userId);

    @Select("select * from role_info")
    List<Role> getRoleList();
    @Select("select * from role_info where `status`=1")
    List<Role> getRoleListFroStatus();

    int addRole(String roleName);

    Role getRoleById(Integer id);

    int updateRole(Role role);

    int updateRoleStatus(Integer status, Integer id);

    int countRoleByName(String roleName);

    void delMenuAll(Integer roleId);

    void addRoleMenu(Integer id, Integer roleId);

    int addRoleUserInfo(Integer roleId, Integer id);

    int updateUserRole(Integer id, Integer roleId);
}
